<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
<script>
        var itera = {
        [Symbol.iterator](){
            return {
                i:0,
                next(){
                    if(this.i < 3){
                        return {value:this.i++, done:false}
                    }
                    return {value:this.i, done:true}
                }
            }
        }
    }
    for(let item of itera){
        console.log(item);
    }
</script>
</body>
</html>